****** Appendix: Table A5
****** Average leader transfer by round for each treatment group
clear all
version 17.0
cd 
import delimited "data\cleaned\uganda_jun17_cleaned.csv", bindquote(strict) varnames(1) clear

gen treat = treatment_pooled
* Subsetting to roles, treatments, rounds, etc of interest
keep if role == "C" & round != 1 & inlist(treat, "Strong Hidden VAT", "Weak Hidden VAT", "Direct Tax", "Windfall") & !inlist(leader_id, "c", "s")
replace treat = "Hidden VAT" if treatment == "Strong Hidden VAT"
replace treat = "Visible VAT" if treatment == "Weak Hidden VAT"



keep date_exp leader_transfer session_exp round leader_id treat sbj_thresh
rename treat treatment
destring leader_transfer, replace


keep date_exp leader_transfer session_exp round leader_id treatment sbj_thresh

collapse (mean) leader_transfer, by(date_exp session_exp round treatment leader_id)

encode treatment, gen(treat)
encode leader_id, gen(leader)


reg leader_transfer i.treat, robust cluster(leader)
est store reg1
reg leader_transfer i.treat i.leader, robust cluster(leader)
est store reg2
reg leader_transfer i.treat i.leader i.round, robust cluster(leader)
est store reg3

estout reg1 reg2 reg3 using "results/apptableA5.tex", cells(b(fmt(3) star) se(par)) starlevels(* 0.1 ** 0.05 *** 0.01) drop(*.leader *.round 1.treat) style(tex) replace

